home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 107_01.zip / TESTTRIG.C < prev    next >
C/C++ Source or Header  |  1993-06-06  |  1KB  |  33 lines

  1.  
  2.  /* simple program to test sine, cosine and tangent functions */
  3.  
  4. main()
  5. {
  6. char *sine(),*cosine(),*degtorad(),*radtodeg();
  7. char s[80],angd[5],angr[5],angd2[5],result[5];
  8. char result2[5],*itof(),*gets();
  9. char *atof(), *fpadd(), initang[5], incrang[5], endang[5];
  10. char result3[5],result4[5],*arctan();
  11. char *arctan2(), result5[5], angatd1[5], angatd2[5];
  12. int scanf(), fpcomp(), index;
  13. int *quadrant;
  14.  
  15.     while (1)
  16.     {printf("\nEnter initial angle in degrees ");
  17.      gets(s);
  18.      atof(initang,s);
  19.      printf("\nEnter increment angle in degrees ");
  20.      gets(s);atof(incrang,s);
  21.      printf("\nEnter end angle in degrees ");
  22.      gets(s);atof(endang,s);
  23.       for(index=0;index<=4;index++) angd[index] = initang[index] ;
  24.      while((fpcomp(angd,endang) <= 0) && (!kbhit() ))
  25.        {
  26.        degtorad(angr,angd);
  27.        radtodeg(angd2,angr);
  28.        printf("\n Input %12.6f deg, %12.6f rad, %12.6f reconv deg",
  29.            angd,angr,angd2);
  30.        sine(result,angr);
  31.        printf("\n sine = %12.6f",result);
  32.        cosine(result2,angr);
  33.        prin